﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;
using System.Web.UI;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for Utility
/// </summary>
public class Utility
{
    public static string GetServerUrl()
    {
        return ConfigurationManager.AppSettings["ServerUrl"].ToString();
    }

    public static string GetAdminHomePageUrl()
    {
        return ConfigurationManager.AppSettings["AdminHomePageUrl"].ToString();
    }

    public static string GetCompanyName()
    {
        return ConfigurationManager.AppSettings["CompanyName"].ToString();
    }

    public static string GetMarkettingHomeUrl()
    {
        return ConfigurationManager.AppSettings["MarkettingHomeUrl"].ToString();
    }

    public static void ShowDhtmlAlert(Control control, string alertMsg)
    {
        ScriptManager.RegisterStartupScript(control, control.GetType(), "ShowAlert", "alert('" + alertMsg + "');", true);
    }

    public static void ShowMsgDiv(HtmlGenericControl divMsg, string msgText, bool isDivInsideTable)
    {
        divMsg.Style["Display"] = isDivInsideTable ? "table-row" : "block";
        divMsg.InnerHtml = msgText;
    }

    public static void HideMsgDiv(HtmlGenericControl divMsg)
    {
        divMsg.Style["Display"] = "none";
        divMsg.InnerHtml = string.Empty; ;
    }

}